UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zK6IqX0ssQEPecf1knU4K5I0piN6qyFiOAeKya7IMzs='
WHERE
key_id = '459a120c59de910053ff606a4d208a7b67a9d5f5ce1c0e646f3666096ec402c5'
AND (
token = 'zK6IqX0ssQEPecf1knU4K5I0piN6qyFiOAeKya7IMzs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)