UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/PXkH6bb4GOt+qnxVSIfXnqYQ/Q6V4xuok8c3v5VlCU=' 
WHERE 
  key_id = '8efa5d719e2b4005fd4fa9e33b2a5e780ac746ab31f5281262279ae633795f8a' 
  AND (
    token = '/PXkH6bb4GOt+qnxVSIfXnqYQ/Q6V4xuok8c3v5VlCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025