UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U81CBXnQGhiWBzxwbYyTZVY68YMki4rYHcU+lEGHbA8=' 
WHERE 
  key_id = 'ac679453968df6c07f452e5dcf9db1b90e493563ce0571f80ff79a3e948dae7c' 
  AND (
    token = 'U81CBXnQGhiWBzxwbYyTZVY68YMki4rYHcU+lEGHbA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042