UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QlX/4uyRzY/AbvJKGEKUJrK72uHVc4MxWB5iITMSnYg=' 
WHERE 
  key_id = '8c2fa3daa2923a8ce43a874664009d4a1014ffe091fce5ddbbf194554686b050' 
  AND (
    token = 'QlX/4uyRzY/AbvJKGEKUJrK72uHVc4MxWB5iITMSnYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016