UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eY5SKrahyBHKP+/QUUkDScY2uPhXkbO8ebtckDOtyZ8=' 
WHERE 
  key_id = '08db37fb4676d9661d1245a1d41f1a1355ea06e031d5f27748667d231402a03a' 
  AND (
    token = 'eY5SKrahyBHKP+/QUUkDScY2uPhXkbO8ebtckDOtyZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042