UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'seD3rbg6MWm/rDRJ49AKdtnSAmjo9hyAL6n5/Vv2jho=' 
WHERE 
  key_id = 'ce280c73526a340362c8b467f9b792b1bc8aaf781f9e11ce1bdd3c30c2486ec6' 
  AND (
    token = 'seD3rbg6MWm/rDRJ49AKdtnSAmjo9hyAL6n5/Vv2jho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033