UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hBpXzsrwco1xVEUOgzVHexv8EwUrGQ/Vwm99LT2p0Fg=' 
WHERE 
  key_id = 'ab81c3adf0eafbcb7f6ec52d2f61059f97499b2f8c59222e13e4bb655d91d4d6' 
  AND (
    token = 'hBpXzsrwco1xVEUOgzVHexv8EwUrGQ/Vwm99LT2p0Fg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050