UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2WiiTb2ohwJmsrPj4JDehhzYnV+b5hf7u4OECi2dZ0I='
WHERE
key_id = '2dee051adb8046dfdafc1361358307dc5ee3ac5cd7b606eb8937c45c2deed06c'
AND (
token = '2WiiTb2ohwJmsrPj4JDehhzYnV+b5hf7u4OECi2dZ0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)