UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QTC6W5Ajhbo1zrHqYW+J0iDLb3TeH2MVNw+xANuSzIg=' 
WHERE 
  key_id = '18f15fee30229e197ac8800c65d32f5eb3f7593bff19e7461d541e577fd6146f' 
  AND (
    token = 'QTC6W5Ajhbo1zrHqYW+J0iDLb3TeH2MVNw+xANuSzIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058