UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aDsVclOljgB7CgIb94I4Z0QyLXzILsSIg5F0IDl5sso='
WHERE
key_id = 'a810564cb5fc138edfbd7ed13c6898e0d3eb14e0309fa0ba1aa87440076012c5'
AND (
token = 'aDsVclOljgB7CgIb94I4Z0QyLXzILsSIg5F0IDl5sso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)