UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZR22N6oXPT8lwIKOSidZopt/+pSCZysDn6LwyfCJk2c='
WHERE
key_id = '820d0ee66ebcbad6849634fb12c4abd85e7bda438bf7961938db00e7f727960a'
AND (
token = 'ZR22N6oXPT8lwIKOSidZopt/+pSCZysDn6LwyfCJk2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)