UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Zx920GunpeD9y57F7BCi/cNT9hEcgfVRJvfVYKW0ts='
WHERE
key_id = '2f2a5ffe468389743b6aaff8894903c5f6a55c6b3448f6339a317f5b8dbbde7c'
AND (
token = '/Zx920GunpeD9y57F7BCi/cNT9hEcgfVRJvfVYKW0ts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)