UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gHSmCBZqMeYtTS/m6T8YDcevCqTmxJyjC//N9iuumBI='
WHERE
key_id = '3adce574809df30aaccfb9ea0f2a2ae58df639a7f01102f6b85cd471cc5dcd4b'
AND (
token = 'gHSmCBZqMeYtTS/m6T8YDcevCqTmxJyjC//N9iuumBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)