UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lnMdZ5k0rwHPBhmWDL+q2bQP3UiYhAX9zVYwNT3FDcE='
WHERE
key_id = '7bc2a22d9d2f5458ca2bf9e4fe28252254d4323df7e2a8aaee6b1be213b308d6'
AND (
token = 'lnMdZ5k0rwHPBhmWDL+q2bQP3UiYhAX9zVYwNT3FDcE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)