UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z0RdGxKCjreFkVjhApcjYmgYHAP0Nvh3H0Bg3GfUGCM='
WHERE
key_id = '3b006cd1d00f31b44bbfcca107b0059cecf5377743db51260ec1f08ad566c51b'
AND (
token = 'Z0RdGxKCjreFkVjhApcjYmgYHAP0Nvh3H0Bg3GfUGCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)