UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UTclp3Rg6VWbestER3IwjJkZ9UtBjGXU3B0ZmIPzBKs=' 
WHERE 
  key_id = '15429c1b903e9e2242082dd19e80d1a378d96fbf6acf29701866da60b6831d01' 
  AND (
    token = 'UTclp3Rg6VWbestER3IwjJkZ9UtBjGXU3B0ZmIPzBKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022