UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DpJbNN8qLULQx/hpUpVT7bLAApsb4eqlcliaK0FSEnA=' 
WHERE 
  key_id = 'c79aefe89a3557340616ccdfc69180d19fd9a8c41fc77300410a49a0e7d4f8ec' 
  AND (
    token = 'DpJbNN8qLULQx/hpUpVT7bLAApsb4eqlcliaK0FSEnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047