UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0X6z+A+Xyab1DTXtaGit0j9hdrxFcwPNgVpT1wKJADA='
WHERE
key_id = '61a04d62b7e7721bc3478caac3e4f1539619534a9727826f14e74a8665700f88'
AND (
token = '0X6z+A+Xyab1DTXtaGit0j9hdrxFcwPNgVpT1wKJADA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)