UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArxsdbnLhpQ+ycsfDmodTMe/Xy/bkoUJ/xmzHmE1XM0='
WHERE
key_id = '99c60fa4602e318a69df271f2c7c62f2726dfef133c2ac902c25b3f8c5233c9c'
AND (
token = 'ArxsdbnLhpQ+ycsfDmodTMe/Xy/bkoUJ/xmzHmE1XM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)