UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kPOhHMtqB8KlGSGN+8aYIr9IejuKdw8+D2ZVeKTDxe8=' 
WHERE 
  key_id = '04783a9ee6e5f7167db10c9da2ca4ea80c9303138939e8ceb860f833321307c6' 
  AND (
    token = 'kPOhHMtqB8KlGSGN+8aYIr9IejuKdw8+D2ZVeKTDxe8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00216