UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'waPqVxy0TMuA4KzMvQHyebh3LyVauQdkzMWWxTeEQo8='
WHERE
key_id = 'f07a526e5eed78f78a0fae7e3e19eecece8099179f62301ca4b6fd783d4abd85'
AND (
token = 'waPqVxy0TMuA4KzMvQHyebh3LyVauQdkzMWWxTeEQo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)