UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8AZbcuK+Vhw85lnExHOuPHjTu2hO/7ef0naldNnhKI='
WHERE
key_id = '999fb9758311f1df19c801ae70c4acf88c49d621ece9fa578d3fcebfc8258abc'
AND (
token = '+8AZbcuK+Vhw85lnExHOuPHjTu2hO/7ef0naldNnhKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)