UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jd7fhT/48NsG5R7KlE468TlSxjKstqpOEp/sb3g3+Xc=' 
WHERE 
  key_id = 'f3fb7158d2eff5b1bc282f10fb019e57e021ee0c3b0e3232d6190e070eb56cf0' 
  AND (
    token = 'Jd7fhT/48NsG5R7KlE468TlSxjKstqpOEp/sb3g3+Xc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056