UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zhW6/ReRd8c6b1UbwDgCPEXZjqKkGaIUtkUc9n6oAU='
WHERE
key_id = '01091594aa3e14e5ba83ea4f5b03d685604d9f87f45fd96162d0a68e3c5c8287'
AND (
token = '7zhW6/ReRd8c6b1UbwDgCPEXZjqKkGaIUtkUc9n6oAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)