UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HA2vCWv3vp/1fRDi0j50bj3zjp6d3ZMcZt2SPm/dOvw=' 
WHERE 
  key_id = '65bf4ac83b8e34bdf9794d97560dc40a8a578d16a18eaa446d781cd6be01cbf4' 
  AND (
    token = 'HA2vCWv3vp/1fRDi0j50bj3zjp6d3ZMcZt2SPm/dOvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039