UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lxOihXMOIZLEEHArVyUGNF1YLoa7fEcDVz963N/Nl0o=' 
WHERE 
  key_id = 'dfdf44d1786efe919a119b5a65cbcdb9b330168bb49188021e8998ec17bfcdcf' 
  AND (
    token = 'lxOihXMOIZLEEHArVyUGNF1YLoa7fEcDVz963N/Nl0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031