UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rvhuYsQnLAFX7y/qio4aDUz4OEMVShMQ6Gr5YzK8VhY=' 
WHERE 
  key_id = '9d09ae08f99f4695c5a3349b37a8480ce6e18da754cf054c963892f9dd258043' 
  AND (
    token = 'rvhuYsQnLAFX7y/qio4aDUz4OEMVShMQ6Gr5YzK8VhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044