UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dQ/VRWlFsQIPsHqkmqslJYNrrAskn25nrbkSwM66qYA=' 
WHERE 
  key_id = 'b6994d8832fcf287b3ffb7d63cf47e0bfa4a7d401e7b800a3cc001c9d6019a37' 
  AND (
    token = 'dQ/VRWlFsQIPsHqkmqslJYNrrAskn25nrbkSwM66qYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035