UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qH1osdRfL2ATOZoBlfyTXTNcIbPaDHKCuWwCQd/ev4M='
WHERE
key_id = '61d5cb8ef352f0733b3ec372170e89fb83f50a85ded2e453f9c35842127197f4'
AND (
token = 'qH1osdRfL2ATOZoBlfyTXTNcIbPaDHKCuWwCQd/ev4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)