UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S2KO/ROz2iPJw7lU3Q9ssL1b0rViefDOgfm1HsP8u6k='
WHERE
key_id = '3c9be2ede365502c94951c3258f86a3093c148510e9b25513dd1f9480a98b0e2'
AND (
token = 'S2KO/ROz2iPJw7lU3Q9ssL1b0rViefDOgfm1HsP8u6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)