UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/CLwSPXmQBClV0IvaVN11CcDbhcBNXbLtJ5+6HKJpBs='
WHERE
key_id = 'dd26eb45b72de0f183294b1983521094b7c681e1f7838d975d33955b494c95e6'
AND (
token = '/CLwSPXmQBClV0IvaVN11CcDbhcBNXbLtJ5+6HKJpBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)