UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4OVt5QJo7XmKr4TVCXoOSHNHd6NwVWa4SmRStdX5FeI='
WHERE
key_id = 'fe0c83a357036fbf679013a6b826c6a83bcca9587630fc5069ac9a0b654a79db'
AND (
token = '4OVt5QJo7XmKr4TVCXoOSHNHd6NwVWa4SmRStdX5FeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)