UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0yYhVdD4uNMjhaKzcYdt/rIWm+ck81PL5vR7MqXCLsU=' 
WHERE 
  key_id = 'cf01bdf7fe12a1a9cbfc596244a0d83335349389bfbed0d3d59256d884d83821' 
  AND (
    token = '0yYhVdD4uNMjhaKzcYdt/rIWm+ck81PL5vR7MqXCLsU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036