UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SIvI1iGaQK+WVIqd4UJvk7nBpsKPT/lJ5l2mDsThJQM=' 
WHERE 
  key_id = '78ea8f353f5bea03296a39a5ea705a1daaee368b89916f1119d1c6d5c075f8d0' 
  AND (
    token = 'SIvI1iGaQK+WVIqd4UJvk7nBpsKPT/lJ5l2mDsThJQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036