UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hkN2eHxCnb+5Z80balAnoBagiaGrxfcy3h7iNmj3Y+c='
WHERE
key_id = '53ea8c7a6fa98c755319d532e345f1f9ef1b49ee5f0db2cd8cb59f881ee81811'
AND (
token = 'hkN2eHxCnb+5Z80balAnoBagiaGrxfcy3h7iNmj3Y+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)