UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LkQOKXYV2wy3UPsq1Y/Bsbp3eJX2sJ72R4t2J7QTRH8=' 
WHERE 
  key_id = '7836420a9145236c5ffe6ed571f5552c83d5b86f8d94dc4044e0420626b31678' 
  AND (
    token = 'LkQOKXYV2wy3UPsq1Y/Bsbp3eJX2sJ72R4t2J7QTRH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036