UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sI5tE30BuDOJ0BWOp6nuv7+0GPZ4PmDWhMyF/C/dPws=' 
WHERE 
  key_id = '839b17011e6d1c492f4ed6b7533ba1af0a4149d616e1256818bbe509ffe261c1' 
  AND (
    token = 'sI5tE30BuDOJ0BWOp6nuv7+0GPZ4PmDWhMyF/C/dPws=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025