UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TxHFlbOtiO9tHWxJFmoVyzb3wxTiv3gTc2z3jkmZCck='
WHERE
key_id = '57405028d2190137f89fdffcd145e4a8bbf3bdf9007e9612c19a753f0cae662c'
AND (
token = 'TxHFlbOtiO9tHWxJFmoVyzb3wxTiv3gTc2z3jkmZCck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)