UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXSKNTsL+MU6UzB0ekANJzxYom3smC7P9DeNtNm8RcM='
WHERE
key_id = 'c03d93e68f41e17d837f82199a92950d0db882679f6f04bd8f1be27601f752d5'
AND (
token = 'nXSKNTsL+MU6UzB0ekANJzxYom3smC7P9DeNtNm8RcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)