UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sxbz29U/dEvFniti1yXqk4648MIG9NbDldm4nIVlpyI=' 
WHERE 
  key_id = 'de5efea1c68402bc8eacf104397d791f3925c6eb2e4545f9c4d83e95c73ef28b' 
  AND (
    token = 'sxbz29U/dEvFniti1yXqk4648MIG9NbDldm4nIVlpyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029