UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43YSJpRBj5GnM18VwyFcOv0q/nNOCiOd0kr1/I/MXBo='
WHERE
key_id = '3c5a003e805eac5c9b885b838ed376eaf3413961590c22f049b64784cb5cb1f5'
AND (
token = '43YSJpRBj5GnM18VwyFcOv0q/nNOCiOd0kr1/I/MXBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)