UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '77523BCEq2+KGIt3EreXWuPg+nOvNDFLQrjLsg6uy5w='
WHERE
key_id = 'f32db3586a34e8004ff8a2dc29dc797ea2ca60be4a5b4ff316cc30b4374029e2'
AND (
token = '77523BCEq2+KGIt3EreXWuPg+nOvNDFLQrjLsg6uy5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)