UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '270Cwcrad48t0jyWCqlm5GRzLxjPtqhGpoZL1N1tLW8=' 
WHERE 
  key_id = '726656c06d4eed96fc668311462acb99c40e4ac37e0d8f9c0959715a61b879eb' 
  AND (
    token = '270Cwcrad48t0jyWCqlm5GRzLxjPtqhGpoZL1N1tLW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022