UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EdaOyR/KaTdxzb6umOf5BkKdI7ehhz4hPvk60Z3Vs7w='
WHERE
key_id = '01714b923dbe84453a0b9a41c000e8c96bd93b2af5334436439cff275f54102d'
AND (
token = 'EdaOyR/KaTdxzb6umOf5BkKdI7ehhz4hPvk60Z3Vs7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)