UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8XNnGt22wpFqRdtUiCxcqxgdBOpX6OOIOp/uW5GfxKw='
WHERE
key_id = '174cf3ce0dcd0105de1b0434eae125a53daa2af0cee918c1f08d875aa1a819dd'
AND (
token = '8XNnGt22wpFqRdtUiCxcqxgdBOpX6OOIOp/uW5GfxKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)