UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c6yGecMzaPbGrxyq/UQDkeeh+35kIwKzeC5PZy4EVXA=' 
WHERE 
  key_id = '080d84c542d679c840c117acf9be7f6e4a9d15f0d907055b0f555e20868af33e' 
  AND (
    token = 'c6yGecMzaPbGrxyq/UQDkeeh+35kIwKzeC5PZy4EVXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024