UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WPZkDP48J3jQO9sCKrVD9xGjg65B0qU0JDtqdRJs+a4='
WHERE
key_id = '03ff91fd9882c0a46b4c08544274dbed195156075641da73b8f9ff48574318ef'
AND (
token = 'WPZkDP48J3jQO9sCKrVD9xGjg65B0qU0JDtqdRJs+a4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)