UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7A2No0OCWJ+PIHY4dnKoJqIddPR/X6mVX6vFIoxSs+I='
WHERE
key_id = '4afa36feb85e66b49b3455066cde8b0ef409b9ed3932fc25a8c90ddc640f6772'
AND (
token = '7A2No0OCWJ+PIHY4dnKoJqIddPR/X6mVX6vFIoxSs+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)