UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1QRjF01Xyvxhsy5Djh7qr0C50chQXfCwsndUV5VzdF0=' 
WHERE 
  key_id = 'b9c901cd0ce6fd615f6b6ae86390dc7f4e62d47f31d013594470682b5dacbfeb' 
  AND (
    token = '1QRjF01Xyvxhsy5Djh7qr0C50chQXfCwsndUV5VzdF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063