UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '49K1+9hdc1HUYtzwb+TurjJtG3TXUosLH1OizAAKqJE=' 
WHERE 
  key_id = 'b106e6a7ee439efa74cda2b5e13a61a8e38660a20a094fcfc6e432a8c825de46' 
  AND (
    token = '49K1+9hdc1HUYtzwb+TurjJtG3TXUosLH1OizAAKqJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031