UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nl43UzshKb1Sc9rAyLEUMiZziMDevF5DC0wzQlCbK7s=' 
WHERE 
  key_id = 'b28a050283c696636f4d2cbd5163a2c3abb0a3a409adfeb599e432430e3b4dd4' 
  AND (
    token = 'Nl43UzshKb1Sc9rAyLEUMiZziMDevF5DC0wzQlCbK7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051