UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Ve3mwYtJzX6xOLFHHKNM2KWF3+2H6FGCu7cRgvC+DE=' 
WHERE 
  key_id = '1c0b4308b8b7704f1aafe70c5d08facae37128628de1db99e48ee6214c3b1c92' 
  AND (
    token = '6Ve3mwYtJzX6xOLFHHKNM2KWF3+2H6FGCu7cRgvC+DE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017