UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u7oXsjmrks2Jf9hC5aTGLAzqWoozuUDuo5TZijG1Fqw=' 
WHERE 
  key_id = '82075d37c7243753b94689db81b3689502ed9b7773c6fb75ba737e258dc1a992' 
  AND (
    token = 'u7oXsjmrks2Jf9hC5aTGLAzqWoozuUDuo5TZijG1Fqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042