UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7EpT2BpEWj1sx/YuDPhen7X87IrtCOnFKnRgh56heBU=' 
WHERE 
  key_id = '259ef969ec3bca3c24d48b6d4ae5e5357650d338220da6eb9f8f84ff3673e891' 
  AND (
    token = '7EpT2BpEWj1sx/YuDPhen7X87IrtCOnFKnRgh56heBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036