UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SG7WprKD41PWTg2p+OC1fw/oMelYmuoMCm7Kz9so9/I='
WHERE
key_id = '7d8b806244103cb686be99bc863190d63fbc3d4f6ce4007d3eae61d727b226b8'
AND (
token = 'SG7WprKD41PWTg2p+OC1fw/oMelYmuoMCm7Kz9so9/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)