UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dfa9NFYTu5hhrJySjfgQh6u23q29WwWx87ISRVkzXyc='
WHERE
key_id = '010893e678890edc7abde09397433096e593cedf533dd7d47b420e7bd263f3b9'
AND (
token = 'dfa9NFYTu5hhrJySjfgQh6u23q29WwWx87ISRVkzXyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)