UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MSPn3PgXQW4kE3r4UTVxA4+hVt5FzF2zAJ0p4szQiSk='
WHERE
key_id = '2fdc63ddbd27783bb26b2b347fc66bc227dede47958929f6d11b7a408539289b'
AND (
token = 'MSPn3PgXQW4kE3r4UTVxA4+hVt5FzF2zAJ0p4szQiSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)