UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+CnJUd+z46ZF5oxeH3LPE7m0pfwBnmvwTftWDCQ7iF4=' 
WHERE 
  key_id = 'eb8af18f29cac22a802ea7e999720ae4c782ec04f1b5d7b9a367f72da88db31d' 
  AND (
    token = '+CnJUd+z46ZF5oxeH3LPE7m0pfwBnmvwTftWDCQ7iF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023