UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's6ucramEbyqSZUkRFz8OffZRIuKrmLx4gzNssYdKexs=' 
WHERE 
  key_id = '4450668bf7fbedf85ff155021837e3f268ae9c45e5366a5b730bb5f3dc1360f7' 
  AND (
    token = 's6ucramEbyqSZUkRFz8OffZRIuKrmLx4gzNssYdKexs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039