UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fIH+/xwJQwYYA4VwufJ6Cv3bOCUZokrn0zPx4pSySdU='
WHERE
key_id = 'bd71c4ddc3bbff2226d46550222435c0b35b415ffbf143f83c93c758c08b52b5'
AND (
token = 'fIH+/xwJQwYYA4VwufJ6Cv3bOCUZokrn0zPx4pSySdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)