UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J5hHGst/BVh79wPJHEbUljryQ2F2EpLPkBxVbGL4NFM=' 
WHERE 
  key_id = 'dc5612f5eec76a56dd03d2911abf86431da70bfdedd397fb28c1f77cb66f0b2e' 
  AND (
    token = 'J5hHGst/BVh79wPJHEbUljryQ2F2EpLPkBxVbGL4NFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051